package com.anonymous;
/**
 * 匿名类
 * @author DingQingbo
 *
 */
public class anonymousDemo {

	public static void main(String[] args) {
		//new 抽象类
		new AbsAnonymous() {
			@Override
			void getname() {
				super.getname();
			}
		}.getname();
		// new 接口
		new Runnable() {
			@Override
			public void run() {
				System.out.println("run");
			}
		}.run();
		
		// new 接口
		ISay s=new ISay() {
			@Override
			public void say() {
				System.out.println("say");
			}
			@Override
			public void eat(String food) {
				System.out.println(food);
			}
		};s.eat("eat food ");
		
		
		
		Runnable r=new Runnable() {
			
			@Override
			public void run() {
				
				System.out.println("123runn");
				
				
				
			}
		};
		r.run();
	}
}
